<template>
  <div class="home-swiper">
    <swiper ref="mySwiper" :options="swiperOptions">
      <swiper-slide v-for="item in swiperList" :key="item.id">
        <img :src="item.src" />
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  data () {
    return {
      swiperList: [
        {
          id: 0,
          src:
            'http://n1-q.mafengwo.net/s8/M00/93/86/wKgBpVYoiOiABLExAAJI8ZtJQtI51.jpeg'
        },
        {
          id: 1,
          src:
            'https://dimg01.c-ctrip.com/images/10020n000000e7icx6C59_C_1600_1200.jpg'
        },
        {
          id: 2,
          src:
            'https://dimg02.c-ctrip.com/images/100e0s000000hscyg0970_R_1600_10000.jpg'
        },
        {
          id: 3,
          src:
            'https://dimg05.c-ctrip.com/images/fd/tg/g1/M06/7B/4B/CghzfVWwvXiAN7MwAAaMrMxfiWU205_R_1600_10000.jpg'
        },
        {
          id: 4,
          src:
            'https://dimg06.c-ctrip.com/images/0103k120006t7ckgl8C33_R_1600_10000.jpg'
        }
      ],
      swiperOptions: {
        pagination: {
          el: '.swiper-pagination'
        },
        loop: true
      }
    }
  }
}
</script>

<style scoped>
.home-swiper {
  background: #eee;
  height: 0;
  padding-bottom: 26.67%;
}
.home-swiper img {
  width: 100%;
  height: 2rem;
}
.home-swiper >>> .swiper-pagination-bullet-active {
  background: #fff;
}
</style>
